/*
** api接口
**
*/

export default (axios) => () => ({

  // 获取轮播图
  getImgs(sid) {
    return axios({
      url: 'fyapi/fyapi/bannerList',
      method: 'GET',
      params: {
        __sid: sid,
        POSITION: 1,
        time: new Date().getTime()
      }
    })
  },
  getNews() {
    return axios({
      url: 'fyapi/fyapi/xinwenList',
      method: 'GET',
      header: {
        "Content-Type": "application/json;charset=UTF-8"
      },
    })
  },
  //获取新闻列表分页
  getNewsye(sid,pageNum= 1) {
    return axios({
      url: 'fyapi/fyapi/xinwenPageList',
      method: 'GET',
      header: {
        "Content-Type": "application/json;charset=UTF-8"
      },
      params: {
        __sid: sid,
        pageNum
      }
    })
  },
  //获取公司动态
  getNewDt(sid,pageNum = 1) {
    return axios({
      url: 'fyapi/fyapi/dongtaiList',
      method: 'GET',
      header: {
        "Content-Type": "application/json;charset=UTF-8"
      },
      params: {
        __sid: sid,
        pageNum
      }
    })
  },
  //技能招聘

  getSkill() {
    return axios({
      url: 'fyapi/fyapi/jishuzhaopinList',
      method: 'GET',
      header: {
        "Content-Type": "application/json;charset=UTF-8"
      },
    })
  },
  //职能招聘
  getfunct(){
  return axios({
    url: 'fyapi/fyapi/zhienngzhaopinList',
    method: 'GET',
    header: {
      "Content-Type": "application/json;charset=UTF-8"
    },
  })
  },
/*  // 登录验证
  isLogin(sid) {
    return axios({
      url: '/a/index.json',
      method: 'GET',
      params: {
        __sid: sid
      }
    })
  },

  // 登录
  login() {
    return axios({
      url: '/a/login',
      method: 'GET',
      params: {
        __login: true,
        __ajax: 'json',
        //username: 'F3EDC7D2C193E0B8DCF554C726719ED2',
        //password: 'E7F5D2F44ADDD6DD8A9A2A4E7AEB79FFEE1460E405598C8E'
        username: 'EB6FD67CF93CC19B51FE189E6FA587F4',
        password: 'A1EAF07BB51B073BB923BD5BEB1AC8F8'
      }
    })
  },



*/

  // 获取新闻详情
  getNewsInfo(sid, id) {
    return axios({
      url: 'fyapi/fyapi/articleInfo',
      method: 'GET',
      params: {
        __sid: sid,
        id
      }
    })
  },



  //获取支付状态
  getPayState(orderId){

    return axios({
      url: 'wanshang-web-protal/byCard/checkPayState',
      method: 'POST',
      header: {
        "Content-Type": "application/json;charset=UTF-8"
      },
      data:{
        "orderId":orderId
      }
    })
  },


  // 个人购卡
  // buyCard(data) {
  //   return axios({
  //     url:'api/byCard/checkParam?buyerName=' + data.buyerName
  //       + '&telephone=' + data.telephone + '&identificationNumber=' + data.identificationNumber
  //       + '&cardAmount=' + Number(data.cardAmount),
  //     method: 'POST'
  //   })
  // },


  // 公司购卡
  // buyCardCompany(data) {
  //   return axios({
  //     url: 'api/byCard/enterpriseBuyCard?&companyName=' + data.companyerName
  //       + '&contantName=' + data.contantName + '&contantTelephone=' + data.contantTelephone
  //       + '&cardCost=' + Number(data.cardAmount) + '&location=' + data.location
  //       + '&tax=' + data.tax,
  //     method: 'POST'
  //   })
  // },

 /* // 获取商户列表
  getMechantList(data) {
    return axios({
      url: 'api/mechant/mechantInfo.do',
      method: 'POST',
      data
    })
  },

  // 获取商户信息
  getMechantInfo(data) {
    return axios({
      url: 'api/mechant/mechantInfo.do',
      method: 'POST',
      data
    })
  },

  // 商户加盟
  merchantJoin(data) {
    return axios({
      url: 'a/merchant/merchantJoin/save?__sid=' + data.sid + '&city=' + data.city
        + '&merchantName=' + data.merchantName + '&contacter=' + data.contacter
        + '&telephone=' + data.telephone + '&location=' + data.location
        + '&message=' + data.message + '&createTime=' + data.createTime,
      method: 'POST'
    })
  },
*/

})
